package me.macd.mindoc.util.constants;

/**
 * Created by macd on 2018-10-01.
 */
public enum BookRole {
    BookFounder(0, "创始人"),
    BookAdmin(1, "管理者"),
    BookEditor(2, "编辑者"),
    BookObserver(3, "观察者");

    private int val;
    private String text;

    BookRole(int val, String text) {
        this.val = val;
        this.text = text;
    }

    public String text() {
        return this.text;
    }

    public static BookRole valueOf(int val) {
        for (BookRole bookRole : BookRole.values()) {
            if (bookRole.val==val) {
                return bookRole;
            }
        }
        return BookObserver;
    }
}
